package com.alks.common.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import org.apache.poi.ss.formula.functions.T;

import java.util.ArrayList;
import java.util.List;

/**
 * @author MS
 * @since 2024/10/19下午4:13
 */
public class EasyExcelListener<T> implements ReadListener<T> {
    /**
     * 缓存的数据
     */
    private List<T> dataList = new ArrayList<>();

    public EasyExcelListener(List<T> dataList){
        this.dataList = dataList;
    }

    @Override
    public void invoke(T data, AnalysisContext analysisContext) {
        dataList.add(data);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        /*不执行任何操作*/
        return;
    }
}
